package it.ap.sa.core.utils.costants;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Alessandro Paolillo
 */
public enum ContentTypeEnum {

     CSV                      ("Comma-Seperated Values"                  ,"text/csv"                                                                 ,".csv" )
    ,JSON                     ("JavaScript Object Notation (JSON)"       ,"application/json"                                                         ,".json")
    ,XLS     				  ("Microsoft Excel"                         ,"application/vnd.ms-excel"                                                 ,".xls" )
    ,XLSX     				  ("Microsoft Office - OOXML - Spreadsheet"  ,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"        ,".xlsx")
    ,MICROSOFT_WORD_DOC       ("Microsoft Word"                          ,"application/msword"                                                       ,".doc" )
    ,MICROSOFT_WORD_DOCX      ("Microsoft Office - OOXML - Word Document","application/vnd.openxmlformats-officedocument.wordprocessingml.document"  ,".docx")
    ,MICROSOFT_POWERPOINT_PPT ("Microsoft PowerPoint"                    ,"application/vnd.ms-powerpoint"                                            ,".ppt" )
    ,MICROSOFT_POWERPOINT_PPTX("Microsoft Office - OOXML - Presentation" ,"application/vnd.openxmlformats-officedocument.presentationml.presentation",".pptx")
    ,ODP                      ("OpenDocument Presentation"               ,"application/vnd.oasis.opendocument.presentation"                          ,".odp" )
    ,ODS                      ("OpenDocument Spreadsheet"                ,"application/vnd.oasis.opendocument.spreadsheet"                           ,".ods" )
    ,ODT                      ("OpenDocument Text"                       ,"application/vnd.oasis.opendocument.text"                                  ,".odt" )
    ,PDF                      ("Adobe Portable Document Format"          ,"application/pdf"                                                          ,".pdf" )
    ,TEXT                	  ("Text File"                               ,"text/plain"                                                               ,".txt" )
    ,XML                      ("XML - Extensible Markup Language"        ,"application/xml"                                                          ,".xml" )
    ,ZIP                      ("Zip Archive"                             ,"application/zip"                                                          ,".zip" )
    ,HTML                     ("HyperText Markup Language (HTML)"        ,"text/html"                                                          		 ,".html")
    ,RTF					  ("Rich Text Format"                        ,"application/rtf"															 ,".rtf")
    ;

	private ContentTypeEnum(String description, String contentType, String estensioneFile) {
		this.description    = description;
		this.contentType    = contentType;
		this.estensioneFile = estensioneFile;
	}
	/**
	 * description file
	 */
	private String description;
	/**
	 * valore content type
	 */
	private String contentType;
	/**
	 * estensione file
	 */
	private String estensioneFile;
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	/**
	 * @return the contentType
	 */
	public String getContentType() {
		return contentType;
	}
	/**
	 * @return the estensioneFile
	 */
	public String getEstensioneFile() {
		return estensioneFile;
	}
	
	/**
     * Lista enum to list string
     * @param list
     * @return
     */
    public static List<String> toList(List<ContentTypeEnum> l) {
    	List<String> list = new ArrayList<String>();
    	
    	if(l != null && !l.isEmpty())
    		for (ContentTypeEnum item : l) list.add(item.name());
			
		return list;
	}
}